import random
while True:
 num = random.randint(0,100)
 zhuang = 5000
 a  = 0
 while zhuang>0:
    A = input("请输入猜的数字")
    A = int(A)
    if  A > num and A < 100:
        print("大了")
        zhuang = zhuang - 500
        print("剩余金额：",zhuang)
        continue
    elif A < num and A >= 0:
        print("小了")
        zhuang = zhuang - 500
        print("剩余金额：",zhuang)
        continue
    elif A == num:
        print("猜中了，奖3000")
        zhuang = zhuang + 3000
        print("剩余金额：",zhuang)
        break
    else:
        print("输入有误重新输入")
 if zhuang == 0:
    print("没钱了请充值")
    break